package com.shrcl.engineerprocess.domain.events;

import com.shrcl.engineerprocess.domain.EngineerMonthlyCost;
import com.shrcl.engineerprocess.domain.events.EngineerMonthlyCostEventsListener;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrcl.engineerprocess.domain.events.EngineerMonthlyCostEventsManager")
public class EngineerMonthlyCostEventsManager extends EntityEventsManager<EngineerMonthlyCost> {
  @Autowired(required = false)
  private Collection<EngineerMonthlyCostEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<EngineerMonthlyCostEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireUpdateCost(final EngineerMonthlyCost entity, final Procedure1<? super EngineerMonthlyCost> updater) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((EngineerMonthlyCostEventsListener)listener).updateCost(entity,updater);
    }
    
  }
  
  public void fireEngineerMonthlyCostUpdate(final EngineerMonthlyCost entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((EngineerMonthlyCostEventsListener)listener).EngineerMonthlyCostUpdate(entity);
    }
    
  }
}
